cmake_minimum_required(VERSION 2.8)

message("-- Project: nettls")


set(src_crypto
    ssl/aes.c
    ssl/arc4.c
    ssl/asn1parse.c
    ssl/asn1write.c
    ssl/base64.c
    ssl/bignum.c
    ssl/blowfish.c
    ssl/camellia.c
    ssl/ccm.c
    ssl/chacha20.c
    ssl/chachapoly.c
    ssl/cipher.c
    ssl/cipher_wrap.c
    ssl/cmac.c
    ssl/ctr_drbg.c
    ssl/des.c
    ssl/dhm.c
    ssl/ecdh.c
    ssl/ecdsa.c
    ssl/ecjpake.c
    ssl/ecp.c
    ssl/ecp_curves.c
    ssl/entropy.c
    ssl/entropy_poll.c
    ssl/error.c
    ssl/gcm.c
    ssl/hkdf.c
    ssl/hmac_drbg.c
    ssl/md.c
    ssl/md5.c
    ssl/md_wrap.c
    ssl/nist_kw.c
    ssl/oid.c
    ssl/pem.c
    ssl/pk.c
    ssl/pk_wrap.c
    ssl/pkcs12.c
    ssl/pkcs5.c
    ssl/pkparse.c
    ssl/pkwrite.c
    ssl/platform.c
    ssl/platform_util.c
    ssl/poly1305.c
    ssl/ripemd160.c
    ssl/rsa.c
    ssl/rsa_internal.c
    ssl/sha1.c
    ssl/sha256.c
    ssl/sha512.c
    ssl/version.c
    ssl/version_features.c
    ssl/xtea.c
)

set(src_x509
    ssl/certs.c
    ssl/pkcs11.c
    ssl/x509.c
    ssl/x509_create.c
    ssl/x509_crl.c
    ssl/x509_crt.c
    ssl/x509_csr.c
    ssl/x509write_crt.c
    ssl/x509write_csr.c
)

set(src_tls
    ssl/debug.c
    ssl/net_sockets.c
    ssl/ssl_cache.c
    ssl/ssl_ciphersuites.c
    ssl/ssl_cli.c
    ssl/ssl_cookie.c
    ssl/ssl_srv.c
    ssl/ssl_ticket.c
    ssl/ssl_tls.c
)

add_library(nettls  STATIC 	${src_tls} ${src_x509} ${src_crypto})
set_target_properties(nettls PROPERTIES OUTPUT_NAME "nettls")

include_directories(
	${PROJECT_SOURCE_DIR}/crt
	${PROJECT_SOURCE_DIR}/nettls)

if (${WIN_OS})

else()

	include_directories(
		/usr/local/include
		/opt/local/include
		/usr/include
		)

    link_directories (
		/usr/local/lib
		/opt/local/lib
		/opt/lib
        )

    set_target_properties(stdcrt PROPERTIES COMPILE_FLAGS ${static})
	set_target_properties(stdcrt PROPERTIES COMPILE_FLAGS ${static_compile})

endif()














